package com.vainycos.lotterysearch.schedule;

import com.vainycos.lotterysearch.service.notify.DingNotify;
import com.vainycos.lotterysearch.utils.FreeApiUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author: Vainycos
 * @description 钉钉消息定时提醒
 * @date: 2022/11/14 15:40
 */
@Slf4j
@Component
public class DingMsgCallSche {

    @Autowired
    private DingNotify dingNotify;

    /**
     * 下午3点钟的下午茶时间
     */
    @Scheduled(cron = "0 0 15 * * *")
    public void drink(){
        dingNotify.notifyMarkdown("下午茶时间", FreeApiUtil.drink());
    }

    /**
     * 早上8点钟的天气时间
     */
    @Scheduled(cron = "0 0 8 * * *")
    public void weather(){
        dingNotify.notifyMarkdown("每日天气", FreeApiUtil.realTimeweather());
    }

}
